import service from '@/utils/request'

// @Tags TodoList
// @Summary 创建代办事项
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.TodoList true "创建代办事项"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /todoList/createTodoList [post]
export const createTodoList = (data) => {
  return service({
    url: '/todoList/createTodoList',
    method: 'post',
    data
  })
}

// @Tags TodoList
// @Summary 删除代办事项
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.TodoList true "删除代办事项"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /todoList/deleteTodoList [delete]
export const deleteTodoList = (params) => {
  return service({
    url: '/todoList/deleteTodoList',
    method: 'delete',
    params
  })
}

// @Tags TodoList
// @Summary 批量删除代办事项
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除代办事项"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /todoList/deleteTodoList [delete]
export const deleteTodoListByIds = (params) => {
  return service({
    url: '/todoList/deleteTodoListByIds',
    method: 'delete',
    params
  })
}

// @Tags TodoList
// @Summary 更新代办事项
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.TodoList true "更新代办事项"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /todoList/updateTodoList [put]
export const updateTodoList = (data) => {
  return service({
    url: '/todoList/updateTodoList',
    method: 'put',
    data
  })
}

// @Tags TodoList
// @Summary 用id查询代办事项
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query model.TodoList true "用id查询代办事项"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /todoList/findTodoList [get]
export const findTodoList = (params) => {
  return service({
    url: '/todoList/findTodoList',
    method: 'get',
    params
  })
}

// @Tags TodoList
// @Summary 分页获取代办事项列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query request.PageInfo true "分页获取代办事项列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /todoList/getTodoListList [get]
export const getTodoListList = (params) => {
  return service({
    url: '/todoList/getTodoListList',
    method: 'get',
    params
  })
}
